TN State Expenditure by Type 2013
lm(formula = ACT_Composite ~ avg_Eng + avg_Math + avg_Sci + Dropout + Pct_Suspended, data = merged_irs)##
## Call:
## lm(formula = ACT_Composite ~ avg_Eng + avg_Math + avg_Sci + Dropout +
## Pct_Suspended, data = merged_irs)
##
## Coefficients:
## (Intercept) avg_Eng avg_Math avg_Sci Dropout
## 11.114965 0.104072 0.010566 0.020567 0.039315
## Pct_Suspended
## 0.003943
model_multi <- lm(formula = ACT_Composite ~ avg_Eng + avg_Math + avg_Sci, data = merged_irs)
plot(model_multi) summary(model_multi)##
## Call:
## lm(formula = ACT_Composite ~ avg_Eng + avg_Math + avg_Sci, data = merged_irs)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.2815 -0.5650 -0.1270 0.4809 1.9070
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 12.114030 0.099123 122.212 < 2e-16 ***
## avg_Eng 0.095159 0.004602 20.676 < 2e-16 ***
## avg_Math 0.010742 0.001736 6.190 6.91e-10 ***
## avg_Sci 0.016612 0.003327 4.994 6.29e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.7008 on 2801 degrees of freedom
## Multiple R-squared: 0.6806, Adjusted R-squared: 0.6803
## F-statistic: 1990 on 3 and 2801 DF, p-value: < 2.2e-16
# use model to predict the results
test_model <- data.frame(avg_Eng = 80, avg_Math = 80, avg_Sci = 80)
test_model2 <- data.frame(avg_Eng = 90, avg_Math = 90, avg_Sci = 90)
test_model3 <- data.frame(avg_Eng = 60, avg_Math = 50, avg_Sci = 60)
#test_counts <- model_multi$agi_amt_avg
predict(model_multi, test_model)## 1
## 21.91506
predict(model_multi, test_model2)## 1
## 23.14019
predict(model_multi, test_model3)## 1
## 19.35738
\[ACT_Composite = 12.114030 + 0.095159 * avg_Eng + 0.010742 * avg_Math + 0.016612 * avg_Sci\]